package com.sn.springboot_netty.ip;

import java.net.InetAddress;
import java.net.InetSocketAddress;

/**
 * @Author fyy
 * @Description
 * @Date 2020/12/1 16:28
 */
public class InetSocketAddressUtil {

    public static void main(String[] args) {
        InetSocketAddress add = new InetSocketAddress("172.22.132.169",8080);
        System.out.println("主机名称：" + add.getHostName());
        System.out.println("主机端口" + add.getPort());
        InetAddress address = add.getAddress();
        System.out.println("主机名称：" + address.getHostName());
        System.out.println("主机IP:" + address.getHostAddress());
    }
}
